import apiClient from './api'

export async function getSchedules(params = {}) {
  const response = await apiClient.get('/schedules', { params })
  return response.data
}

export async function getRoomSchedule(roomId) {
  const response = await apiClient.get(`/schedules/room/${roomId}`)
  return response.data
}

export async function getSchedule(id) {
  const response = await apiClient.get(`/schedules/${id}`)
  return response.data
}

export async function createSchedule(scheduleData) {
  const response = await apiClient.post('/schedules', scheduleData)
  return response.data
}

export async function createDefaultSchedule(roomId) {
  const response = await apiClient.post(`/schedules/default/${roomId}`)
  return response.data
}

export async function updateSchedule(id, scheduleData) {
  const response = await apiClient.put(`/schedules/${id}`, scheduleData)
  return response.data
}

export async function deleteSchedule(id) {
  const response = await apiClient.delete(`/schedules/${id}`)
  return response.data
}
